<li id="products-menu">
    <button id="products"><?php echo d_products ?></button>
    <button id="select">Select an action</button>
    <ul id="products-sub" class="ui-widget-header ui-corner-all">
        <li><button id="description_templates"><?php echo d_description_templates ?></button></li>
        <li><button id="filters"><?php echo d_filters ?></button></li>
    </ul>
</li>
<style>
    #products-sub{
        position: absolute;
        visibility:hidden;
        padding:4px;
        margin-top: 10px;
        
        moz-border-radius-topright: 0px;
        -webkit-border-top-right-radius: 0px;
        -khtml-border-top-right-radius: 0px;
        border-top-right-radius: 0px;
        
        moz-border-radius-topleft: 0px;
        -webkit-border-top-left-radius: 0px;
        -khtml-border-top-left-radius: 0px;
        border-top-left-radius: 0px;
        
        border-top: none;
    }
</style>
<script>
$(document).ready(function(){
    //hidden
    submenu_state = 0;
    
    $("#products-sub").appendTo("body")
    $("#products").button();
    $("#select").button({
        text: false,
        icons: {
                primary: "ui-icon-triangle-1-s"
        }
    })
    .click(function(){
        if(submenu_state){
            $("#products-sub").css("visibility", "hidden").appendTo("body");
            submenu_state = 0;
           
        }
        else{
            $("#products-sub").css("visibility", "visible").appendTo("#products-menu");
            submenu_state = 1;
        }
        
    })
    //$("#asdd").buttonset();
    $("#products-menu").buttonset()
    
    $("#description_templates").button();
    $("#filters").button();
    
});
</script>